﻿// =================================================================== 
// 项目说明
//====================================================================
// Wup。@Copy Right 2014
// 文件： user1.cs
// 项目名称：买车网
// 创建时间：2014/12/23
// 负责人：Wup
// ===================================================================
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Text;
using Weixin.Entity.ChinaTax;
using Weixin.Utils;


namespace Weixin.DAL.ChinaTax
{
    /// <summary>
    /// 数据层实例化接口类 dbo.user1.
    /// </summary>
    public partial class user1DataAccessLayer 
    {
		#region 构造函数


		/// <summary>
		/// 
		/// </summary>
		public user1DataAccessLayer()
		{
		}
		#endregion

        #region -----------实例化接口函数-----------
		
		#region 添加更新删除
		/// <summary>
		/// 向数据库中插入一条新记录。
		/// </summary>
		/// <param name="_user1Model">user1实体</param>
		/// <returns>新插入记录的编号</returns>
		public int Insert(user1Entity _user1Model)
		{
			string sqlStr="insert into user1([username],[password],[contactor],[sex],[position],[email],[tel],[fax],[mobile],[site],[Base],[province],[city],[education],[level],[jobTitle],[jobTime],[regDate],[lastLoginTime],[loginIP],[IdentityCard],[QQ],[Address],[PostCode],[School],[CertificateLevel],[CertificateOther],[CertificateNum],[CertificatePubDate],[Company],[Department],[JobContent],[Forte],[JobStatus],[Salary],[UpdateTime],[Status],[TotalPoints],[ValidPoints],[IsVip],[IntegrityRate],[Photo],[Weixin]) values(@username,@password,@contactor,@sex,@position,@email,@tel,@fax,@mobile,@site,@Base,@province,@city,@education,@level,@jobTitle,@jobTime,@regDate,@lastLoginTime,@loginIP,@IdentityCard,@QQ,@Address,@PostCode,@School,@CertificateLevel,@CertificateOther,@CertificateNum,@CertificatePubDate,@Company,@Department,@JobContent,@Forte,@JobStatus,@Salary,@UpdateTime,@Status,@TotalPoints,@ValidPoints,@IsVip,@IntegrityRate,@Photo,@Weixin) select @@identity";
			int res;
			SqlParameter[] _param={
			new SqlParameter("@username",SqlDbType.VarChar),
			new SqlParameter("@password",SqlDbType.VarChar),
			new SqlParameter("@contactor",SqlDbType.VarChar),
			new SqlParameter("@sex",SqlDbType.VarChar),
			new SqlParameter("@position",SqlDbType.VarChar),
			new SqlParameter("@email",SqlDbType.VarChar),
			new SqlParameter("@tel",SqlDbType.VarChar),
			new SqlParameter("@fax",SqlDbType.VarChar),
			new SqlParameter("@mobile",SqlDbType.VarChar),
			new SqlParameter("@site",SqlDbType.VarChar),
			new SqlParameter("@Base",SqlDbType.Int),
			new SqlParameter("@province",SqlDbType.VarChar),
			new SqlParameter("@city",SqlDbType.VarChar),
			new SqlParameter("@education",SqlDbType.VarChar),
			new SqlParameter("@level",SqlDbType.VarChar),
			new SqlParameter("@jobTitle",SqlDbType.VarChar),
			new SqlParameter("@jobTime",SqlDbType.VarChar),
			new SqlParameter("@regDate",SqlDbType.DateTime),
			new SqlParameter("@lastLoginTime",SqlDbType.DateTime),
			new SqlParameter("@loginIP",SqlDbType.VarChar),
			new SqlParameter("@IdentityCard",SqlDbType.VarChar),
			new SqlParameter("@QQ",SqlDbType.VarChar),
			new SqlParameter("@Address",SqlDbType.VarChar),
			new SqlParameter("@PostCode",SqlDbType.VarChar),
			new SqlParameter("@School",SqlDbType.VarChar),
			new SqlParameter("@CertificateLevel",SqlDbType.VarChar),
			new SqlParameter("@CertificateOther",SqlDbType.VarChar),
			new SqlParameter("@CertificateNum",SqlDbType.VarChar),
			new SqlParameter("@CertificatePubDate",SqlDbType.VarChar),
			new SqlParameter("@Company",SqlDbType.VarChar),
			new SqlParameter("@Department",SqlDbType.VarChar),
			new SqlParameter("@JobContent",SqlDbType.VarChar),
			new SqlParameter("@Forte",SqlDbType.VarChar),
			new SqlParameter("@JobStatus",SqlDbType.VarChar),
			new SqlParameter("@Salary",SqlDbType.Int),
			new SqlParameter("@UpdateTime",SqlDbType.DateTime),
			new SqlParameter("@Status",SqlDbType.SmallInt),
			new SqlParameter("@TotalPoints",SqlDbType.Int),
			new SqlParameter("@ValidPoints",SqlDbType.Int),
			new SqlParameter("@IsVip",SqlDbType.SmallInt),
			new SqlParameter("@IntegrityRate",SqlDbType.Int),
			new SqlParameter("@Photo",SqlDbType.VarChar),
			new SqlParameter("@Weixin",SqlDbType.VarChar)
			};			
			_param[0].Value=_user1Model.username;
			_param[1].Value=_user1Model.password;
			_param[2].Value=_user1Model.contactor;
			_param[3].Value=_user1Model.sex;
			_param[4].Value=_user1Model.position;
			_param[5].Value=_user1Model.email;
			_param[6].Value=_user1Model.tel;
			_param[7].Value=_user1Model.fax;
			_param[8].Value=_user1Model.mobile;
			_param[9].Value=_user1Model.site;
			_param[10].Value=_user1Model.Base;
			_param[11].Value=_user1Model.province;
			_param[12].Value=_user1Model.city;
			_param[13].Value=_user1Model.education;
			_param[14].Value=_user1Model.level;
			_param[15].Value=_user1Model.jobTitle;
			_param[16].Value=_user1Model.jobTime;
			_param[17].Value=_user1Model.regDate;
			_param[18].Value=_user1Model.lastLoginTime;
			_param[19].Value=_user1Model.loginIP;
			_param[20].Value=_user1Model.IdentityCard;
			_param[21].Value=_user1Model.QQ;
			_param[22].Value=_user1Model.Address;
			_param[23].Value=_user1Model.PostCode;
			_param[24].Value=_user1Model.School;
			_param[25].Value=_user1Model.CertificateLevel;
			_param[26].Value=_user1Model.CertificateOther;
			_param[27].Value=_user1Model.CertificateNum;
			_param[28].Value=_user1Model.CertificatePubDate;
			_param[29].Value=_user1Model.Company;
			_param[30].Value=_user1Model.Department;
			_param[31].Value=_user1Model.JobContent;
			_param[32].Value=_user1Model.Forte;
			_param[33].Value=_user1Model.JobStatus;
			_param[34].Value=_user1Model.Salary;
			_param[35].Value=_user1Model.UpdateTime;
			_param[36].Value=_user1Model.Status;
			_param[37].Value=_user1Model.TotalPoints;
			_param[38].Value=_user1Model.ValidPoints;
			_param[39].Value=_user1Model.IsVip;
			_param[40].Value=_user1Model.IntegrityRate;
			_param[41].Value=_user1Model.Photo;
			_param[42].Value=_user1Model.Weixin;
			res = Convert.ToInt32(SqlHelper.ExecuteScalar(WebConfig.ChinaTax,CommandType.Text,sqlStr,_param));
			return res;
		}
		/// <summary>
		/// 向数据库中插入一条新记录。带事务
		/// </summary>
		/// <param name="sp">事务对象</param>
		/// <param name="_user1Model">user1实体</param>
		/// <returns>新插入记录的编号</returns>
		public int Insert(SqlTransaction sp,user1Entity _user1Model)
		{
			string sqlStr="insert into user1([username],[password],[contactor],[sex],[position],[email],[tel],[fax],[mobile],[site],[Base],[province],[city],[education],[level],[jobTitle],[jobTime],[regDate],[lastLoginTime],[loginIP],[IdentityCard],[QQ],[Address],[PostCode],[School],[CertificateLevel],[CertificateOther],[CertificateNum],[CertificatePubDate],[Company],[Department],[JobContent],[Forte],[JobStatus],[Salary],[UpdateTime],[Status],[TotalPoints],[ValidPoints],[IsVip],[IntegrityRate],[Photo],[Weixin]) values(@username,@password,@contactor,@sex,@position,@email,@tel,@fax,@mobile,@site,@Base,@province,@city,@education,@level,@jobTitle,@jobTime,@regDate,@lastLoginTime,@loginIP,@IdentityCard,@QQ,@Address,@PostCode,@School,@CertificateLevel,@CertificateOther,@CertificateNum,@CertificatePubDate,@Company,@Department,@JobContent,@Forte,@JobStatus,@Salary,@UpdateTime,@Status,@TotalPoints,@ValidPoints,@IsVip,@IntegrityRate,@Photo,@Weixin) select @@identity";
			int res;
			SqlParameter[] _param={
			new SqlParameter("@username",SqlDbType.VarChar),
			new SqlParameter("@password",SqlDbType.VarChar),
			new SqlParameter("@contactor",SqlDbType.VarChar),
			new SqlParameter("@sex",SqlDbType.VarChar),
			new SqlParameter("@position",SqlDbType.VarChar),
			new SqlParameter("@email",SqlDbType.VarChar),
			new SqlParameter("@tel",SqlDbType.VarChar),
			new SqlParameter("@fax",SqlDbType.VarChar),
			new SqlParameter("@mobile",SqlDbType.VarChar),
			new SqlParameter("@site",SqlDbType.VarChar),
			new SqlParameter("@Base",SqlDbType.Int),
			new SqlParameter("@province",SqlDbType.VarChar),
			new SqlParameter("@city",SqlDbType.VarChar),
			new SqlParameter("@education",SqlDbType.VarChar),
			new SqlParameter("@level",SqlDbType.VarChar),
			new SqlParameter("@jobTitle",SqlDbType.VarChar),
			new SqlParameter("@jobTime",SqlDbType.VarChar),
			new SqlParameter("@regDate",SqlDbType.DateTime),
			new SqlParameter("@lastLoginTime",SqlDbType.DateTime),
			new SqlParameter("@loginIP",SqlDbType.VarChar),
			new SqlParameter("@IdentityCard",SqlDbType.VarChar),
			new SqlParameter("@QQ",SqlDbType.VarChar),
			new SqlParameter("@Address",SqlDbType.VarChar),
			new SqlParameter("@PostCode",SqlDbType.VarChar),
			new SqlParameter("@School",SqlDbType.VarChar),
			new SqlParameter("@CertificateLevel",SqlDbType.VarChar),
			new SqlParameter("@CertificateOther",SqlDbType.VarChar),
			new SqlParameter("@CertificateNum",SqlDbType.VarChar),
			new SqlParameter("@CertificatePubDate",SqlDbType.VarChar),
			new SqlParameter("@Company",SqlDbType.VarChar),
			new SqlParameter("@Department",SqlDbType.VarChar),
			new SqlParameter("@JobContent",SqlDbType.VarChar),
			new SqlParameter("@Forte",SqlDbType.VarChar),
			new SqlParameter("@JobStatus",SqlDbType.VarChar),
			new SqlParameter("@Salary",SqlDbType.Int),
			new SqlParameter("@UpdateTime",SqlDbType.DateTime),
			new SqlParameter("@Status",SqlDbType.SmallInt),
			new SqlParameter("@TotalPoints",SqlDbType.Int),
			new SqlParameter("@ValidPoints",SqlDbType.Int),
			new SqlParameter("@IsVip",SqlDbType.SmallInt),
			new SqlParameter("@IntegrityRate",SqlDbType.Int),
			new SqlParameter("@Photo",SqlDbType.VarChar),
			new SqlParameter("@Weixin",SqlDbType.VarChar)
			};			
			_param[0].Value=_user1Model.username;
			_param[1].Value=_user1Model.password;
			_param[2].Value=_user1Model.contactor;
			_param[3].Value=_user1Model.sex;
			_param[4].Value=_user1Model.position;
			_param[5].Value=_user1Model.email;
			_param[6].Value=_user1Model.tel;
			_param[7].Value=_user1Model.fax;
			_param[8].Value=_user1Model.mobile;
			_param[9].Value=_user1Model.site;
			_param[10].Value=_user1Model.Base;
			_param[11].Value=_user1Model.province;
			_param[12].Value=_user1Model.city;
			_param[13].Value=_user1Model.education;
			_param[14].Value=_user1Model.level;
			_param[15].Value=_user1Model.jobTitle;
			_param[16].Value=_user1Model.jobTime;
			_param[17].Value=_user1Model.regDate;
			_param[18].Value=_user1Model.lastLoginTime;
			_param[19].Value=_user1Model.loginIP;
			_param[20].Value=_user1Model.IdentityCard;
			_param[21].Value=_user1Model.QQ;
			_param[22].Value=_user1Model.Address;
			_param[23].Value=_user1Model.PostCode;
			_param[24].Value=_user1Model.School;
			_param[25].Value=_user1Model.CertificateLevel;
			_param[26].Value=_user1Model.CertificateOther;
			_param[27].Value=_user1Model.CertificateNum;
			_param[28].Value=_user1Model.CertificatePubDate;
			_param[29].Value=_user1Model.Company;
			_param[30].Value=_user1Model.Department;
			_param[31].Value=_user1Model.JobContent;
			_param[32].Value=_user1Model.Forte;
			_param[33].Value=_user1Model.JobStatus;
			_param[34].Value=_user1Model.Salary;
			_param[35].Value=_user1Model.UpdateTime;
			_param[36].Value=_user1Model.Status;
			_param[37].Value=_user1Model.TotalPoints;
			_param[38].Value=_user1Model.ValidPoints;
			_param[39].Value=_user1Model.IsVip;
			_param[40].Value=_user1Model.IntegrityRate;
			_param[41].Value=_user1Model.Photo;
			_param[42].Value=_user1Model.Weixin;
			res = Convert.ToInt32(SqlHelper.ExecuteScalar(sp,CommandType.Text,sqlStr,_param));
			return res;
		}


		/// <summary>
		/// 向数据表user1更新一条记录。
		/// </summary>
		/// <param name="_user1Model">_user1Model</param>
		/// <returns>影响的行数</returns>
		public int Update(user1Entity _user1Model)
		{
            string sqlStr="update user1 set [username]=@username,[password]=@password,[contactor]=@contactor,[sex]=@sex,[position]=@position,[email]=@email,[tel]=@tel,[fax]=@fax,[mobile]=@mobile,[site]=@site,[Base]=@Base,[province]=@province,[city]=@city,[education]=@education,[level]=@level,[jobTitle]=@jobTitle,[jobTime]=@jobTime,[regDate]=@regDate,[lastLoginTime]=@lastLoginTime,[loginIP]=@loginIP,[IdentityCard]=@IdentityCard,[QQ]=@QQ,[Address]=@Address,[PostCode]=@PostCode,[School]=@School,[CertificateLevel]=@CertificateLevel,[CertificateOther]=@CertificateOther,[CertificateNum]=@CertificateNum,[CertificatePubDate]=@CertificatePubDate,[Company]=@Company,[Department]=@Department,[JobContent]=@JobContent,[Forte]=@Forte,[JobStatus]=@JobStatus,[Salary]=@Salary,[UpdateTime]=@UpdateTime,[Status]=@Status,[TotalPoints]=@TotalPoints,[ValidPoints]=@ValidPoints,[IsVip]=@IsVip,[IntegrityRate]=@IntegrityRate,[Photo]=@Photo,[Weixin]=@Weixin where ID=@ID";
			SqlParameter[] _param={				
				new SqlParameter("@ID",SqlDbType.Int),
				new SqlParameter("@username",SqlDbType.VarChar),
				new SqlParameter("@password",SqlDbType.VarChar),
				new SqlParameter("@contactor",SqlDbType.VarChar),
				new SqlParameter("@sex",SqlDbType.VarChar),
				new SqlParameter("@position",SqlDbType.VarChar),
				new SqlParameter("@email",SqlDbType.VarChar),
				new SqlParameter("@tel",SqlDbType.VarChar),
				new SqlParameter("@fax",SqlDbType.VarChar),
				new SqlParameter("@mobile",SqlDbType.VarChar),
				new SqlParameter("@site",SqlDbType.VarChar),
				new SqlParameter("@Base",SqlDbType.Int),
				new SqlParameter("@province",SqlDbType.VarChar),
				new SqlParameter("@city",SqlDbType.VarChar),
				new SqlParameter("@education",SqlDbType.VarChar),
				new SqlParameter("@level",SqlDbType.VarChar),
				new SqlParameter("@jobTitle",SqlDbType.VarChar),
				new SqlParameter("@jobTime",SqlDbType.VarChar),
				new SqlParameter("@regDate",SqlDbType.DateTime),
				new SqlParameter("@lastLoginTime",SqlDbType.DateTime),
				new SqlParameter("@loginIP",SqlDbType.VarChar),
				new SqlParameter("@IdentityCard",SqlDbType.VarChar),
				new SqlParameter("@QQ",SqlDbType.VarChar),
				new SqlParameter("@Address",SqlDbType.VarChar),
				new SqlParameter("@PostCode",SqlDbType.VarChar),
				new SqlParameter("@School",SqlDbType.VarChar),
				new SqlParameter("@CertificateLevel",SqlDbType.VarChar),
				new SqlParameter("@CertificateOther",SqlDbType.VarChar),
				new SqlParameter("@CertificateNum",SqlDbType.VarChar),
				new SqlParameter("@CertificatePubDate",SqlDbType.VarChar),
				new SqlParameter("@Company",SqlDbType.VarChar),
				new SqlParameter("@Department",SqlDbType.VarChar),
				new SqlParameter("@JobContent",SqlDbType.VarChar),
				new SqlParameter("@Forte",SqlDbType.VarChar),
				new SqlParameter("@JobStatus",SqlDbType.VarChar),
				new SqlParameter("@Salary",SqlDbType.Int),
				new SqlParameter("@UpdateTime",SqlDbType.DateTime),
				new SqlParameter("@Status",SqlDbType.SmallInt),
				new SqlParameter("@TotalPoints",SqlDbType.Int),
				new SqlParameter("@ValidPoints",SqlDbType.Int),
				new SqlParameter("@IsVip",SqlDbType.SmallInt),
				new SqlParameter("@IntegrityRate",SqlDbType.Int),
				new SqlParameter("@Photo",SqlDbType.VarChar),
				new SqlParameter("@Weixin",SqlDbType.VarChar)
				};				
				_param[0].Value=_user1Model.ID;
				_param[1].Value=_user1Model.username;
				_param[2].Value=_user1Model.password;
				_param[3].Value=_user1Model.contactor;
				_param[4].Value=_user1Model.sex;
				_param[5].Value=_user1Model.position;
				_param[6].Value=_user1Model.email;
				_param[7].Value=_user1Model.tel;
				_param[8].Value=_user1Model.fax;
				_param[9].Value=_user1Model.mobile;
				_param[10].Value=_user1Model.site;
				_param[11].Value=_user1Model.Base;
				_param[12].Value=_user1Model.province;
				_param[13].Value=_user1Model.city;
				_param[14].Value=_user1Model.education;
				_param[15].Value=_user1Model.level;
				_param[16].Value=_user1Model.jobTitle;
				_param[17].Value=_user1Model.jobTime;
				_param[18].Value=_user1Model.regDate;
				_param[19].Value=_user1Model.lastLoginTime;
				_param[20].Value=_user1Model.loginIP;
				_param[21].Value=_user1Model.IdentityCard;
				_param[22].Value=_user1Model.QQ;
				_param[23].Value=_user1Model.Address;
				_param[24].Value=_user1Model.PostCode;
				_param[25].Value=_user1Model.School;
				_param[26].Value=_user1Model.CertificateLevel;
				_param[27].Value=_user1Model.CertificateOther;
				_param[28].Value=_user1Model.CertificateNum;
				_param[29].Value=_user1Model.CertificatePubDate;
				_param[30].Value=_user1Model.Company;
				_param[31].Value=_user1Model.Department;
				_param[32].Value=_user1Model.JobContent;
				_param[33].Value=_user1Model.Forte;
				_param[34].Value=_user1Model.JobStatus;
				_param[35].Value=_user1Model.Salary;
				_param[36].Value=_user1Model.UpdateTime;
				_param[37].Value=_user1Model.Status;
				_param[38].Value=_user1Model.TotalPoints;
				_param[39].Value=_user1Model.ValidPoints;
				_param[40].Value=_user1Model.IsVip;
				_param[41].Value=_user1Model.IntegrityRate;
				_param[42].Value=_user1Model.Photo;
				_param[43].Value=_user1Model.Weixin;
			return SqlHelper.ExecuteNonQuery(WebConfig.ChinaTax,CommandType.Text,sqlStr,_param);
		}
		/// <summary>
		/// 向数据表user1更新一条记录。带事务
		/// </summary>
		/// <param name="sp">事务对象</param>
		/// <param name="_user1Model">_user1Model</param>
		/// <returns>影响的行数</returns>
		public int Update(SqlTransaction sp,user1Entity _user1Model)
		{
            string sqlStr="update user1 set [username]=@username,[password]=@password,[contactor]=@contactor,[sex]=@sex,[position]=@position,[email]=@email,[tel]=@tel,[fax]=@fax,[mobile]=@mobile,[site]=@site,[Base]=@Base,[province]=@province,[city]=@city,[education]=@education,[level]=@level,[jobTitle]=@jobTitle,[jobTime]=@jobTime,[regDate]=@regDate,[lastLoginTime]=@lastLoginTime,[loginIP]=@loginIP,[IdentityCard]=@IdentityCard,[QQ]=@QQ,[Address]=@Address,[PostCode]=@PostCode,[School]=@School,[CertificateLevel]=@CertificateLevel,[CertificateOther]=@CertificateOther,[CertificateNum]=@CertificateNum,[CertificatePubDate]=@CertificatePubDate,[Company]=@Company,[Department]=@Department,[JobContent]=@JobContent,[Forte]=@Forte,[JobStatus]=@JobStatus,[Salary]=@Salary,[UpdateTime]=@UpdateTime,[Status]=@Status,[TotalPoints]=@TotalPoints,[ValidPoints]=@ValidPoints,[IsVip]=@IsVip,[IntegrityRate]=@IntegrityRate,[Photo]=@Photo,[Weixin]=@Weixin where ID=@ID";
			SqlParameter[] _param={				
				new SqlParameter("@ID",SqlDbType.Int),
				new SqlParameter("@username",SqlDbType.VarChar),
				new SqlParameter("@password",SqlDbType.VarChar),
				new SqlParameter("@contactor",SqlDbType.VarChar),
				new SqlParameter("@sex",SqlDbType.VarChar),
				new SqlParameter("@position",SqlDbType.VarChar),
				new SqlParameter("@email",SqlDbType.VarChar),
				new SqlParameter("@tel",SqlDbType.VarChar),
				new SqlParameter("@fax",SqlDbType.VarChar),
				new SqlParameter("@mobile",SqlDbType.VarChar),
				new SqlParameter("@site",SqlDbType.VarChar),
				new SqlParameter("@Base",SqlDbType.Int),
				new SqlParameter("@province",SqlDbType.VarChar),
				new SqlParameter("@city",SqlDbType.VarChar),
				new SqlParameter("@education",SqlDbType.VarChar),
				new SqlParameter("@level",SqlDbType.VarChar),
				new SqlParameter("@jobTitle",SqlDbType.VarChar),
				new SqlParameter("@jobTime",SqlDbType.VarChar),
				new SqlParameter("@regDate",SqlDbType.DateTime),
				new SqlParameter("@lastLoginTime",SqlDbType.DateTime),
				new SqlParameter("@loginIP",SqlDbType.VarChar),
				new SqlParameter("@IdentityCard",SqlDbType.VarChar),
				new SqlParameter("@QQ",SqlDbType.VarChar),
				new SqlParameter("@Address",SqlDbType.VarChar),
				new SqlParameter("@PostCode",SqlDbType.VarChar),
				new SqlParameter("@School",SqlDbType.VarChar),
				new SqlParameter("@CertificateLevel",SqlDbType.VarChar),
				new SqlParameter("@CertificateOther",SqlDbType.VarChar),
				new SqlParameter("@CertificateNum",SqlDbType.VarChar),
				new SqlParameter("@CertificatePubDate",SqlDbType.VarChar),
				new SqlParameter("@Company",SqlDbType.VarChar),
				new SqlParameter("@Department",SqlDbType.VarChar),
				new SqlParameter("@JobContent",SqlDbType.VarChar),
				new SqlParameter("@Forte",SqlDbType.VarChar),
				new SqlParameter("@JobStatus",SqlDbType.VarChar),
				new SqlParameter("@Salary",SqlDbType.Int),
				new SqlParameter("@UpdateTime",SqlDbType.DateTime),
				new SqlParameter("@Status",SqlDbType.SmallInt),
				new SqlParameter("@TotalPoints",SqlDbType.Int),
				new SqlParameter("@ValidPoints",SqlDbType.Int),
				new SqlParameter("@IsVip",SqlDbType.SmallInt),
				new SqlParameter("@IntegrityRate",SqlDbType.Int),
				new SqlParameter("@Photo",SqlDbType.VarChar),
				new SqlParameter("@Weixin",SqlDbType.VarChar)
				};				
				_param[0].Value=_user1Model.ID;
				_param[1].Value=_user1Model.username;
				_param[2].Value=_user1Model.password;
				_param[3].Value=_user1Model.contactor;
				_param[4].Value=_user1Model.sex;
				_param[5].Value=_user1Model.position;
				_param[6].Value=_user1Model.email;
				_param[7].Value=_user1Model.tel;
				_param[8].Value=_user1Model.fax;
				_param[9].Value=_user1Model.mobile;
				_param[10].Value=_user1Model.site;
				_param[11].Value=_user1Model.Base;
				_param[12].Value=_user1Model.province;
				_param[13].Value=_user1Model.city;
				_param[14].Value=_user1Model.education;
				_param[15].Value=_user1Model.level;
				_param[16].Value=_user1Model.jobTitle;
				_param[17].Value=_user1Model.jobTime;
				_param[18].Value=_user1Model.regDate;
				_param[19].Value=_user1Model.lastLoginTime;
				_param[20].Value=_user1Model.loginIP;
				_param[21].Value=_user1Model.IdentityCard;
				_param[22].Value=_user1Model.QQ;
				_param[23].Value=_user1Model.Address;
				_param[24].Value=_user1Model.PostCode;
				_param[25].Value=_user1Model.School;
				_param[26].Value=_user1Model.CertificateLevel;
				_param[27].Value=_user1Model.CertificateOther;
				_param[28].Value=_user1Model.CertificateNum;
				_param[29].Value=_user1Model.CertificatePubDate;
				_param[30].Value=_user1Model.Company;
				_param[31].Value=_user1Model.Department;
				_param[32].Value=_user1Model.JobContent;
				_param[33].Value=_user1Model.Forte;
				_param[34].Value=_user1Model.JobStatus;
				_param[35].Value=_user1Model.Salary;
				_param[36].Value=_user1Model.UpdateTime;
				_param[37].Value=_user1Model.Status;
				_param[38].Value=_user1Model.TotalPoints;
				_param[39].Value=_user1Model.ValidPoints;
				_param[40].Value=_user1Model.IsVip;
				_param[41].Value=_user1Model.IntegrityRate;
				_param[42].Value=_user1Model.Photo;
				_param[43].Value=_user1Model.Weixin;
			return SqlHelper.ExecuteNonQuery(sp,CommandType.Text,sqlStr,_param);
		}		
		
		
		/// <summary>
		/// 删除数据表user1中的一条记录
		/// </summary>
	    /// <param name="ID">iD</param>
		/// <returns>影响的行数</returns>
		public int Delete(int ID)
		{
			string sqlStr="delete from user1 where [ID]=@ID";
			SqlParameter[] _param={			
			new SqlParameter("@ID",SqlDbType.Int),
			
			};			
			_param[0].Value=ID;
			return SqlHelper.ExecuteNonQuery(WebConfig.ChinaTax,CommandType.Text,sqlStr,_param);
		}
		
		/// <summary>
		/// 删除数据表user1中的一条记录,带事务
		/// </summary>
		/// <param name="sp">事务对象</param>
	    /// <param name="ID">iD</param>
		/// <returns>影响的行数</returns>
		public int Delete(SqlTransaction sp,int ID)
		{
			string sqlStr="delete from user1 where [ID]=@ID";
			SqlParameter[] _param={			
			new SqlParameter("@ID",SqlDbType.Int),
			
			};			
			_param[0].Value=ID;
			return SqlHelper.ExecuteNonQuery(sp,CommandType.Text,sqlStr,_param);
		}
		#endregion
		
		#region 数据实体
		/// <summary>
		/// 得到  user1 数据实体
		/// </summary>
		/// <param name="row">row</param>
		/// <returns>user1 数据实体</returns>
		public user1Entity Populate_user1Entity_FromDr(DataRow row)
		{
			user1Entity Obj = new user1Entity();
			if(row!=null)
			{
				Obj.ID = (( row["ID"])==DBNull.Value)?0:Convert.ToInt32( row["ID"]);
				Obj.username =  row["username"].ToString();
				Obj.password =  row["password"].ToString();
				Obj.contactor =  row["contactor"].ToString();
				Obj.sex =  row["sex"].ToString();
				Obj.position =  row["position"].ToString();
				Obj.email =  row["email"].ToString();
				Obj.tel =  row["tel"].ToString();
				Obj.fax =  row["fax"].ToString();
				Obj.mobile =  row["mobile"].ToString();
				Obj.site =  row["site"].ToString();
				Obj.Base = (( row["Base"])==DBNull.Value)?0:Convert.ToInt32( row["Base"]);
				Obj.province =  row["province"].ToString();
				Obj.city =  row["city"].ToString();
				Obj.education =  row["education"].ToString();
				Obj.level =  row["level"].ToString();
				Obj.jobTitle =  row["jobTitle"].ToString();
				Obj.jobTime =  row["jobTime"].ToString();
				Obj.regDate = (( row["regDate"])==DBNull.Value)?Convert.ToDateTime("1900-1-1"):Convert.ToDateTime( row["regDate"]);
				Obj.lastLoginTime = (( row["lastLoginTime"])==DBNull.Value)?Convert.ToDateTime("1900-1-1"):Convert.ToDateTime( row["lastLoginTime"]);
				Obj.loginIP =  row["loginIP"].ToString();
				Obj.IdentityCard =  row["IdentityCard"].ToString();
				Obj.QQ =  row["QQ"].ToString();
				Obj.Address =  row["Address"].ToString();
				Obj.PostCode =  row["PostCode"].ToString();
				Obj.School =  row["School"].ToString();
				Obj.CertificateLevel =  row["CertificateLevel"].ToString();
				Obj.CertificateOther =  row["CertificateOther"].ToString();
				Obj.CertificateNum =  row["CertificateNum"].ToString();
				Obj.CertificatePubDate =  row["CertificatePubDate"].ToString();
				Obj.Company =  row["Company"].ToString();
				Obj.Department =  row["Department"].ToString();
				Obj.JobContent =  row["JobContent"].ToString();
				Obj.Forte =  row["Forte"].ToString();
				Obj.JobStatus =  row["JobStatus"].ToString();
				Obj.Salary = (( row["Salary"])==DBNull.Value)?0:Convert.ToInt32( row["Salary"]);
				Obj.UpdateTime = (( row["UpdateTime"])==DBNull.Value)?Convert.ToDateTime("1900-1-1"):Convert.ToDateTime( row["UpdateTime"]);
				Obj.Status = (( row["Status"])==DBNull.Value)? (short)0 : (short)  row["Status"];
				Obj.TotalPoints = (( row["TotalPoints"])==DBNull.Value)?0:Convert.ToInt32( row["TotalPoints"]);
				Obj.ValidPoints = (( row["ValidPoints"])==DBNull.Value)?0:Convert.ToInt32( row["ValidPoints"]);
				Obj.IsVip = (( row["IsVip"])==DBNull.Value)? (short)0 : (short)  row["IsVip"];
				Obj.IntegrityRate = (( row["IntegrityRate"])==DBNull.Value)?0:Convert.ToInt32( row["IntegrityRate"]);
				Obj.Photo =  row["Photo"].ToString();
				Obj.Weixin =  row["Weixin"].ToString();
			}
			else
			{
				return null;
			}
			return Obj;
		}
		
        /// <summary>
		/// 得到  user1 数据实体
		/// </summary>
		/// <param name="dr">dr</param>
		/// <returns>user1 数据实体</returns>
		public user1Entity Populate_user1Entity_FromDr(IDataReader dr)
		{
			user1Entity Obj = new user1Entity();
			
				Obj.ID = (( dr["ID"])==DBNull.Value)?0:Convert.ToInt32( dr["ID"]);
				Obj.username =  dr["username"].ToString();
				Obj.password =  dr["password"].ToString();
				Obj.contactor =  dr["contactor"].ToString();
				Obj.sex =  dr["sex"].ToString();
				Obj.position =  dr["position"].ToString();
				Obj.email =  dr["email"].ToString();
				Obj.tel =  dr["tel"].ToString();
				Obj.fax =  dr["fax"].ToString();
				Obj.mobile =  dr["mobile"].ToString();
				Obj.site =  dr["site"].ToString();
				Obj.Base = (( dr["Base"])==DBNull.Value)?0:Convert.ToInt32( dr["Base"]);
				Obj.province =  dr["province"].ToString();
				Obj.city =  dr["city"].ToString();
				Obj.education =  dr["education"].ToString();
				Obj.level =  dr["level"].ToString();
				Obj.jobTitle =  dr["jobTitle"].ToString();
				Obj.jobTime =  dr["jobTime"].ToString();
				Obj.regDate = (( dr["regDate"])==DBNull.Value)?Convert.ToDateTime("1900-1-1"):Convert.ToDateTime( dr["regDate"]);
				Obj.lastLoginTime = (( dr["lastLoginTime"])==DBNull.Value)?Convert.ToDateTime("1900-1-1"):Convert.ToDateTime( dr["lastLoginTime"]);
				Obj.loginIP =  dr["loginIP"].ToString();
				Obj.IdentityCard =  dr["IdentityCard"].ToString();
				Obj.QQ =  dr["QQ"].ToString();
				Obj.Address =  dr["Address"].ToString();
				Obj.PostCode =  dr["PostCode"].ToString();
				Obj.School =  dr["School"].ToString();
				Obj.CertificateLevel =  dr["CertificateLevel"].ToString();
				Obj.CertificateOther =  dr["CertificateOther"].ToString();
				Obj.CertificateNum =  dr["CertificateNum"].ToString();
				Obj.CertificatePubDate =  dr["CertificatePubDate"].ToString();
				Obj.Company =  dr["Company"].ToString();
				Obj.Department =  dr["Department"].ToString();
				Obj.JobContent =  dr["JobContent"].ToString();
				Obj.Forte =  dr["Forte"].ToString();
				Obj.JobStatus =  dr["JobStatus"].ToString();
				Obj.Salary = (( dr["Salary"])==DBNull.Value)?0:Convert.ToInt32( dr["Salary"]);
				Obj.UpdateTime = (( dr["UpdateTime"])==DBNull.Value)?Convert.ToDateTime("1900-1-1"):Convert.ToDateTime( dr["UpdateTime"]);
				Obj.Status = (( dr["Status"])==DBNull.Value)? (short)0 : (short)  dr["Status"];
				Obj.TotalPoints = (( dr["TotalPoints"])==DBNull.Value)?0:Convert.ToInt32( dr["TotalPoints"]);
				Obj.ValidPoints = (( dr["ValidPoints"])==DBNull.Value)?0:Convert.ToInt32( dr["ValidPoints"]);
				Obj.IsVip = (( dr["IsVip"])==DBNull.Value)? (short)0 : (short)  dr["IsVip"];
				Obj.IntegrityRate = (( dr["IntegrityRate"])==DBNull.Value)?0:Convert.ToInt32( dr["IntegrityRate"]);
				Obj.Photo =  dr["Photo"].ToString();
				Obj.Weixin =  dr["Weixin"].ToString();
			
			return Obj;
		}
		#endregion
		
		/// <summary>
		/// 根据ID,返回一个user1对象
		/// </summary>
		/// <param name="iD">iD</param>
		/// <returns>user1对象</returns>
		public user1Entity Get_user1Entity (int iD)
		{
			user1Entity _obj=null;
			SqlParameter[] _param={
			new SqlParameter("@ID",SqlDbType.Int)
			};
			_param[0].Value=iD;
			string sqlStr="select * from user1 with(nolock) where ID=@ID";
			using(SqlDataReader dr=SqlHelper.ExecuteReader(WebConfig.ChinaTax,CommandType.Text,sqlStr,_param))
			{
				while(dr.Read())
				{
            		_obj=Populate_user1Entity_FromDr(dr);
				}
			}
			return _obj;
		}
		/// <summary>
		/// 得到数据表user1所有记录
		/// </summary>
		/// <returns>数据集</returns>
		public IList< user1Entity> Get_user1All()
		{
			IList< user1Entity> Obj=new List< user1Entity>();
			string sqlStr="select * from user1";
			using(SqlDataReader dr=SqlHelper.ExecuteReader(WebConfig.ChinaTax,CommandType.Text,sqlStr))
			{
				while(dr.Read())
				{
					Obj.Add(Populate_user1Entity_FromDr(dr));
				}
			}
			return Obj;
		}
		/// <summary>
        /// 检测是否存在根据主键
        /// </summary>
        /// <param name="iD">iD</param>
        /// <returns>是/否</returns>
		public bool IsExistuser1(int iD)
		{
			SqlParameter[] _param={
                                      new SqlParameter("@iD",SqlDbType.Int)
                                  };
            _param[0].Value=iD;
            string sqlStr="select Count(*) from user1 where ID=@iD";
            int a=Convert.ToInt32(SqlHelper.ExecuteScalar(WebConfig.ChinaTax,CommandType.Text,sqlStr,_param));
            if(a>0)
            {
                return true;
            }
            else
            {
                return false;
            }
		}

        #endregion
		
		#region----------自定义实例化接口函数----------
		#endregion
    }
}
